package elion.com.theElion.util.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.jude.rollviewpager.adapter.StaticPagerAdapter;

import elion.com.elion.R;

/**
 * Created by 61002_000 on 2017/6/12.
 */

public class MyPagerAdapter  extends StaticPagerAdapter
{
    private int[] imgs =
            {
                    R.mipmap.pager_img1,
                    R.mipmap.pager_img2,
                    R.mipmap.pager_img3,
                    R.mipmap.pager_img4,
                    R.mipmap.pager_img5,
                    R.mipmap.pager_img6
            };

        @Override
        public View getView(ViewGroup container, int position)
        {
            ImageView view = new ImageView(container.getContext());
            view.setImageResource(imgs[position]);
            view.setScaleType(ImageView.ScaleType.CENTER_CROP);
            view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
            return view;
        }

        @Override
        public int getCount() {
            return imgs.length;
        }

}
